

/*---------------------------------------------------------
   Initializes the effect. The data is a table of data 
   which was passed from the server.
---------------------------------------------------------*/
function EFFECT:Init( data )
	
	self.Pos = data:GetOrigin()
	self.Ang = data:GetAngle():Forward()
	self.Vel = data:GetStart()
	self.DieTime = math.Rand(0,.05)
	self.Size = math.Rand(15,18)
	self.Emitter = ParticleEmitter( self.Entity.Pos )
	
		local particle = self.Emitter:Add("effects/muzzleflash"..math.random(1,4), self.Pos  )

		particle:SetVelocity(self.Vel)
		particle:SetDieTime( self.DieTime )
		particle:SetStartAlpha( math.random( 200, 220 ) )
		particle:SetEndAlpha( 100 )
		particle:SetStartSize( self.Size )
		particle:SetEndSize( self.Size )
		particle:SetRoll( math.Rand( -180, 180 ) )
		particle:SetRollDelta( math.Rand( -0.1, 0.1 ) )
		particle:SetColor( 200,180,20 )
		
		local particle = self.Emitter:Add("effects/muzzleflash"..math.random(1,4), self.Pos + (self.Ang*5) )

		particle:SetVelocity(self.Vel)
		particle:SetDieTime( self.DieTime )
		particle:SetStartAlpha( math.random( 200, 220 ) )
		particle:SetEndAlpha( 100 )
		particle:SetStartSize( self.Size/2 )
		particle:SetEndSize( self.Size/2 )
		particle:SetRoll( math.Rand( -180, 180 ) )
		particle:SetRollDelta( math.Rand( -0.1, 0.1 ) )
		particle:SetColor( 200,180,20 )
		
		self.Emitter:Finish()

end


/*---------------------------------------------------------
   THINK
   Returning false makes the entity die
---------------------------------------------------------*/
function EFFECT:Think( )
	return false
end


/*---------------------------------------------------------
   Draw the effect
---------------------------------------------------------*/
function EFFECT:Render()
	// Do nothing - this effect is only used to spawn the particles in Init
end
